/*
 * @Description: 保存用户数据
 * @Author: wuxiao
 * @Date: 2018-02-28 16:10:10
 * @Last Modified by: wuxiao
 * @Last Modified time: 2018-02-27 16:20:19
 */
import {LOCAL_STORAGE} from './Constants';
import {StorageHelper} from './StorageHelper';

class UserHelper {
    /**
     * 设置userName
     * @param userName
     */
    static setUserName(userName) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.USER_NAME, userName);
    }

    /**
     * 获取userName
     */
    static getUserName() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.USER_NAME);
    }

    /**
     * 移除userName
     */
    static clearUserName() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.USER_NAME);
    }

    /**
     * 设置userId
     * @param userId
     */
    static setUserId(userId) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.USER_ID, userId);
    }

    /**
     * 获取userId
     */
    static getUserId() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.USER_ID);
    }

    /**
     * 移除userId
     */
    static clearUserId() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.USER_ID);
    }

    /**
     * 设置userCostCenterId
     * @param userCostCenterId
     */
    static setUserCostCenterId(costCenterId) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.COST_CENTER_ID, costCenterId);
    }

    /**
     * 获取userCostCenterId
     */
    static getUserCostCenterId() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.COST_CENTER_ID);
    }

    /**
     * 移除userCostCenterId
     */
    static clearUserCostCenterId() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.COST_CENTER_ID);
    }

    /**
     * 设置userCostCenter
     * @param userCostCenter
     */
    static setUserCostCenter(costCenter) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.COST_CENTER, costCenter);
    }

    /**
     * 获取userCostCenter
     */
    static getUserCostCenter() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.COST_CENTER);
    }

    /**
     * 移除userCostCenter
     */
    static clearUserCostCenter() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.COST_CENTER);
    }
    /**
     * 设置token
     * @param token
     */
    static setToken(token) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.TOEKN, token);
    }

    /**
     * 获取token
     */
    static getToken() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.TOEKN);
    }

    /**
     * 移除token
     */
    static clearToken() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.TOEKN);
    }

    /**
     * 设置分类选择状态
     * @param status
     */
    static setCatStatus(status) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.CAT_STATUS, status);
    }

    /**
     * 获取类选择状态
     */
    static getCatStatus() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.CAT_STATUS);
    }

    /**
     * 移除类选择状态
     */
    static clearCatStatus() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.CAT_STATUS);
    }

    /**
     * 设置 搜索机构Id
     * @param searchId
     */
    static setSearchOrgId(searchId) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.SEARCH_ORG_ID, searchId);
    }

    /**
     * 获取搜索机构Id
     */
    static getSearchOrgId() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.SEARCH_ORG_ID);
    }

    /**
     * 移除搜索机构Id
     */
    static clearSearchOrgId() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.SEARCH_ORG_ID);
    }

    /**
     * 设置 用户默认机构Id
     * @param organizationId
     */
    static setOrganizationId(organizationId) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.ORGANIZATION_ID, organizationId);
    }

    /**
     * 获取用户默认机构Id
     */
    static getOrganizationId() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.ORGANIZATION_ID);
    }

    /**
     * 移除用户默认机构Id
     */
    static clearOrganizationId() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.ORGANIZATION_ID);
    }

    /**
     * 设置 用户默认机构名称
     * @param organizationId
     */
    static setOrganizationName(organizationName) {
        StorageHelper.sessionSet(LOCAL_STORAGE.KEY.ORGANIZATION_NAME, organizationName);
    }

    /**
     * 获取用户默认机构名称
     */
    static getOrganizationName() {
        return StorageHelper.sessionGet(LOCAL_STORAGE.KEY.ORGANIZATION_NAME);
    }

    /**
     * 移除用户默认机构名称
     */
    static clearOrganizationName() {
        StorageHelper.sessionRemove(LOCAL_STORAGE.KEY.ORGANIZATION_NAME);
    }
}


export default UserHelper;
export {UserHelper};
